<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>
<%@include file="../common/jscss.jsp"%>
<script type="text/javascript">
	
var grid_ae = null;
var dialog_ae = null;
$(function(){
	grid_ae = $("#discuss_grid").ligerGrid({
			checkbox: true,
			title : '点评列表',
            columns: [
            { display: '点评id', name: 'id', isSort : false, width: 100 },
            { display: '会员名称', name: 'memberName',isSort : false, width: 100 },
            { display: '点评对象', name: 'ownerName',isSort : false, width: 200 },
            { display: '人气', name: 'popul',isSort : false, width: 100 },
            { display: '规模', name: 'proportion',isSort : false, width: 100 },
            { display: '服务', name: 'serving',isSort : false, width: 100 },
            { display: '娱乐', name: 'recreation',isSort : false, width: 100 },
            { display: '总评', name: 'overall',isSort : false, width: 100 },
            { display: '点评内容', name: 'content',isSort : false, width: 150 ,
            	render: function(record, rowindex, value, column){
            		var htmlR = "<span title='"+value+"'>"+value+"</span>";
               	 	return htmlR;
                 }
            },
            { display: '创建时间', name: 'gmtCreated',isSort : false,
              render: function(record, rowindex, value, column){
            	 return (new Date(value.time)).format("yyyy年MM月dd日 hh:mm:ss");
              }}, 
            { display: '最后修改时间', name: 'gmtModified',isSort : false,
              render: function(record, rowindex, value, column){
            	 return (new Date(value.time)).format("yyyy年MM月dd日 hh:mm:ss");
              }
            },
            {
            	display: '操作', 
            	name: 'status',
            	isAllowHide: false, 
            	isSort : false,
				render: function (record, rowindex, value, column){
				//this     这里指向grid
				//record   行数据
				//rowindex 行索引
				//value    当前的值，对应record[column.name]
				//column   列信息
					var html = "";
					if(record.isAudit=='00'){
						html = '<a onclick="aduitDis(\''+ record.id + '\')" href="javascript:;">未审核</a>'; 
					}
					if(record.isAudit=='01'){
						html = '<span>审核通过</span>'; 
					}if(record.isAudit=='02'){
						html = '<span>未通过</span>';
					}
					return html; 
				}
            }
            ], 
            pageSize:10,
            root :'list',
            record:'totalRecord',
            url: "/misc/discomment/discuss.htm", 
            width: '99%',height:'99%',
            isChecked: f_isChecked, onCheckRow: f_onCheckRow, onCheckAllRow: f_onCheckAllRow
        });
	
	$("#parent").ligerComboBox({
		width : 215,
		selectBoxWidth : 215,
		selectBoxHeight : 180,
		valueField : 'mark',
		textField : 'text',
		treeLeafOnly : false,
		tree : {
			checkbox : false,
			btnClickToToggleOnly : false,
			url : '/misc/cms/channelTree.htm'
		}
	});	
});
function search(){
	grid_ae.options.parms = [{name:'memberName',value:$("#search_name").val()}];
	grid_ae.loadData();
}
function aduitDis(id){
	dialog_ae = $.ligerDialog.open({ height: 400,width:400, url: "/misc/discomment/aduitDis.htm?id="+id, isResize: false ,modal:true,title:'审核点评'});
}
</script>
<table>
	<tr>
		<td>
			<div id="searchbar">
			   会员名：<input id="search_name" type="text" />
			    	  <input id="btnOK" type="button" value="查询" onclick="search()" />
			</div>
		</td>
		<td><input type="text" id="parent"/><button onclick="pushDiscuss()" id="tui_song" style="position:relative;left:220px;top:-22px; margin:0 0 -20px 0;">推送</button></td>
	</tr>
</table>
<div id="discuss_grid" style="margin:0; padding:0"></div>
